using System;

namespace UserManagement
{
    /// <summary>
    /// 用户类型枚举
    /// </summary>
    public enum UserType
    {
        /// <summary>
        /// 职员
        /// </summary>
        Staff = 0,
        
        /// <summary>
        /// 运维人员
        /// </summary>
        Maintainer = 1,
        
        /// <summary>
        /// 患者
        /// </summary>
        Patient = 2,
        
        /// <summary>
        /// 服务商
        /// </summary>
        Provider = 3
    }
    
    /// <summary>
    /// 用户状态枚举
    /// </summary>
    public enum UserState
    {
        /// <summary>
        /// 已禁用
        /// </summary>
        Disabled = -1,
        
        /// <summary>
        /// 未激活
        /// </summary>
        UnActive = 0,
        
        /// <summary>
        /// 已激活
        /// </summary>
        Active = 1,
        
        /// <summary>
        /// 已锁定
        /// </summary>
        Locked = 2
    }
    
    /// <summary>
    /// 用户实体类
    /// </summary>
    public class User
    {
        /// <summary>
        /// ID
        /// </summary>
        public Guid Id { get; set; }
        
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }
        
        /// <summary>
        /// 用户姓名
        /// </summary>
        public string Name { get; set; }
        
        /// <summary>
        /// 邮箱
        /// </summary>
        public string? Email { get; set; }
        
        /// <summary>
        /// 电话号码
        /// </summary>
        public string? PhoneNumber { get; set; }
        
        /// <summary>
        /// 性别
        /// </summary>
        public string Gender { get; set; }
        
        /// <summary>
        /// 出生日期
        /// </summary>
        public DateTime? Birthday { get; set; }
        
        /// <summary>
        /// 用户类型
        /// </summary>
        public UserType Type { get; set; }
        
        /// <summary>
        /// 是否管理员
        /// </summary>
        public bool IsAdmin { get; set; }
        
        /// <summary>
        /// 头像
        /// </summary>
        public string? Avatar { get; set; }
        
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        
        /// <summary>
        /// 状态
        /// </summary>
        public UserState State { get; set; }
        
        /// <summary>
        /// 状态变更原因
        /// </summary>
        public string? StateChangedReason { get; set; }
        
        /// <summary>
        /// 登录失败次数
        /// </summary>
        public int? FailedLoginCount { get; set; }
        
        /// <summary>
        /// 上次登录失败时间
        /// </summary>
        public DateTime? LastFailedLoginTime { get; set; }
        
        /// <summary>
        /// 组织ID
        /// </summary>
        public string OrgId { get; set; }
        
        /// <summary>
        /// 医院ID
        /// </summary>
        public string? HosId { get; set; }
        
        /// <summary>
        /// 院区ID
        /// </summary>
        public string? BranchId { get; set; }
    }
}
